package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class InfoFrame extends JFrame {

	private JPanel contentPane;
	private JLabel lblDipartimento;
	private JLabel lblStudente;
	private JLabel lblMatricola;
	private JLabel lblCorso;
	private JButton btnChiudi;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					InfoFrame frame = new InfoFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public InfoFrame() {
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 338, 227);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(null);
		setContentPane(contentPane);
		contentPane.add(getLblDipartimento());
		contentPane.add(getLblStudente());
		contentPane.add(getLblMatricola());
		contentPane.add(getLblCorso());
		contentPane.add(getBtnChiudi());
	}
	private JLabel getLblDipartimento() {
		if (lblDipartimento == null) {
			lblDipartimento = new JLabel("D.I.M.E.S. Anno 2012/2013\n");
			lblDipartimento.setBounds(37, 14, 243, 22);
		}
		return lblDipartimento;
	}
	private JLabel getLblStudente() {
		if (lblStudente == null) {
			lblStudente = new JLabel("STUDENTE: Siciliano Cateno Lorenzo");
			lblStudente.setBounds(37, 77, 272, 16);
		}
		return lblStudente;
	}
	private JLabel getLblMatricola() {
		if (lblMatricola == null) {
			lblMatricola = new JLabel("MATRICOLA: 134683");
			lblMatricola.setBounds(37, 105, 266, 16);
		}
		return lblMatricola;
	}
	private JLabel getLblCorso() {
		if (lblCorso == null) {
			lblCorso = new JLabel("CORSO: Ingegneria del software");
			lblCorso.setBounds(37, 48, 272, 17);
		}
		return lblCorso;
	}
	private JButton getBtnChiudi() {
		if (btnChiudi == null) {
			btnChiudi = new JButton("chiudi");
			btnChiudi.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					dispose();
				}
			});
			btnChiudi.setBounds(110, 159, 117, 29);
		}
		return btnChiudi;
	}
}
